package com.ruoyi.psi.quality.report.mapper;

import com.ruoyi.psi.quality.report.domain.InspectReportCond;
import com.ruoyi.psi.quality.report.domain.InspectReportDomain;
import com.ruoyi.psi.quality.report.domain.InspectReportDto;
import com.ruoyi.psi.quality.report.domain.InspectReportList;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 质检报告
 * 数据层
 */
public interface InspectReportMapper {
    /**
     * 查询质检报告
     * @param cond 查询条件
     * @return
     */
    public List<InspectReportDto> selectInspectReportList(InspectReportCond cond);

    /**
     * 查询对应编号质检报告
     * @param inspectReportId 质检编号
     * @return
     */
    public InspectReportDto selectInspectReportById(String inspectReportId);

    /**
     * 获取最新的一条产品质检编号
     * @return
     */
    public String getInspectReportId();

    /**
     * 新增质检报告
     * @param inspectReport
     * @return
     */
    public int insertInspectReport(InspectReportDomain inspectReport);

    /**
     * 更新质检报告
     * @param inspectReport
     * @return
     */
    public int updateInspectReport(InspectReportDomain inspectReport);

    /**
     * 删除质检报告
     * 仅修改删除标志位
     * @param inspectReport
     * @return
     */
    public int updateInspectReportDeleteFlag(InspectReportDomain inspectReport);

    /**
     * 查询所有详情信息
     * @param cond
     * @return
     */
    public List<InspectReportList> selectInspectReportListList(InspectReportCond cond);

    /**
     * 查询对应编号的所有质检数据
     * @return
     */
    List<InspectReportList> selectInspectReportListListById(String inspectReportId);

    /**
     * 查询对应编号质检报告产品信息
     * @param inspectReportId 质检报告编号
     * @param inspectItemId 产品编号
     * @return
     */
    public InspectReportList selectInspectReportListById(@Param("inspectReportId") String inspectReportId,@Param("inspectItemId")int inspectItemId);

    /**
     * 新增质检报告产品信息
     * @param inspectReportProduce
     * @return
     */
    public int insertInspectReportList(InspectReportList inspectReportProduce);

    /**
     * 更新质检报告产品信息
     * @param inspectReportProduce
     * @return
     */
    public int updateInspectReportList(InspectReportList inspectReportProduce);

    /**
     * 删除对应所有产品质检信息
     * @param inspectReportId
     * @return
     */
    int deleteInspectReportListById(@Param("inspectReportId")String inspectReportId, @Param("inspectItemId")int inspectItemId);
}
